/*
 * WorkspaceFactory.cpp
 *
 *  Created on: 05/05/2013
 *      Author: juan
 */

#include "gui/SubWindow/WorkspaceFactory.h"
#include "utils/constantes.h"
#include "gui/SubWindow/WorkspaceDER.h"
#include "gui/SubWindow/WorkspaceClases.h"

Workspace* WorkspaceFactory::getWorkspaceByType(Diagram* diagram)
{

    Workspace* workspace;

    switch(diagram->getType()){
    case DIAGRAMA_CLASES:
        workspace = new WorkspaceClases(diagram);
        break;
    case DIAGRAMA_DER:
        workspace = new WorkspaceDER(diagram);
        break;
    default:
        workspace = new WorkspaceDER(diagram);
        break;
    }

    return workspace;

}

Workspace* WorkspaceFactory::getEmptyWorkspace(int type) {
	Workspace* workspace;
	switch(type) {
	    case DIAGRAMA_CLASES:
	        workspace = new WorkspaceClases(NULL);
	        break;
	    case DIAGRAMA_DER:
	        workspace = new WorkspaceDER(NULL);
	        break;
	    default:
	    	workspace = NULL;
	        break;
	    }

	    return workspace;
}
